import java.util.ArrayList;


/**
 * This class holds a list of Edges
 * @author ldong
 *
 */
public class EdgeList {

    private ArrayList<Edge> list;
    
    /**
     * Constructor 
     */
    public EdgeList()
    {
    	list = new ArrayList<Edge>();
    }
    
    /**
     * Add a edge to the list
     * @param e
     * @return
     */
    public boolean addEdge2List(Edge e)
    {
    	if(list.contains(e))
    		return false;

    	list.add(e);
    	return true;
    }
    
    /**
     * get size 
     * @return
     */
    public int size()
    {
    	return list.size();
    }
    
    /**
     * Get the list
     * @return
     */
    public ArrayList<Edge> getList() {
		return list;
	}

	/**
	 * Set the list
	 * @param list
	 */
	public void setList(ArrayList<Edge> list) {
		this.list = list;
	}


	/**
	 * overriding toString method
	 */
	public String toString()
    {
    	String temp = "";
    	for(int i = 0 ; i < list.size(); i++)
    		temp += list.get(i);
    	
    	return temp;
    }
}
